package com.hxzy.service.impl;


import com.hxzy.dto.HouseTypesSearchDTO;
import com.hxzy.entity.HouseTypes;
import com.hxzy.mapper.HouseTypesMapper;
import com.hxzy.service.HouseTypesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class HouseTypesServiceImpl extends CommonServiceImpl<HouseTypes, Integer> implements HouseTypesService {


    private HouseTypesMapper houseTypesMapper;

    @Autowired
    public void setHouseTypesMapper(HouseTypesMapper houseTypesMapper) {
        this.houseTypesMapper = houseTypesMapper;
        super.setMyBatisBaseDao(houseTypesMapper);
    }

    @Override
    public List<HouseTypes> search(HouseTypesSearchDTO housetypesSearchDTO) {
        return this.houseTypesMapper.search(housetypesSearchDTO);
    }

    @Override
    public int existsName(Integer id, String name) {
        return this.houseTypesMapper.existsName(id, name);
    }
}
